<%@ page language="java" import="java.util.*,com.zczx.gislab.model.Userinfo" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
Userinfo UserInfo = (Userinfo)session.getAttribute("userinfo");
String photoUrl="";
if(UserInfo==null){
	UserInfo = new Userinfo();
	UserInfo.setDefaultrole("");
	UserInfo.setPhoto("");
	UserInfo.setName("");
	photoUrl="./imgs/useralt.png";
}else{
	photoUrl=basePath+"photos/"+UserInfo.getPhoto();
}
%>
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title></title>

	<link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap.min.css">
	<link rel="stylesheet" href="./style/page.css" >
	<link rel="stylesheet" href="./style/cOmCourse.css">
	<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
	<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
	<!--[if lt IE 9]>
	<script src="http://cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
	<script src="http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
	<![endif]-->
	<script type="text/javascript">
		var UserID= '<%=session.getAttribute("userid")%>';
        // 设置标题
        var LessonID=<%=request.getParameter("lid")%>;
        document.getElementsByTagName("title")[0].setAttribute("data-localize",!LessonID?"kc_creat_course":"kc_modify_course");
        if (!UserID || UserID == "" || UserID == "null") {
			location.href="https://sso.supermap.com/login?service="+window.location.protocol+"//"+window.location.host+"/University/login";
        }
		var UserInfo={};
		UserInfo.name='<%=UserInfo.getName()%>';
		UserInfo.nickname='<%=UserInfo.getNickname()%>';
		UserInfo.university='<%=UserInfo.getUniversity()%>';
		UserInfo.major='<%=UserInfo.getMajor()%>';
		UserInfo.photo='<%=photoUrl%>';
		UserInfo.sex='<%=UserInfo.getSex()%>';
		UserInfo.enteryear='<%=UserInfo.getEnteryear()%>';
	</script>
</head>
<body>
<%@ include file="head.jsp"%>
<!--页面主体-->
<div id="container" class="container-fluid">
	<img src="./script/layerui/skin/default/loading-1.gif" alt="loading">
	<div class="container-fluid" id="createCourse">
		<ul class="nav nav-pills" role="tablist">
			<li role="presentation" class="active"><a href="#ctcourse" role="tab" data-toggle="tab" data-localize="mc_fillcourseinfo"></a></li>
			<li role="presentation"><a href="#setcourseexcise" role="tab" data-toggle="tab" data-localize="mc_addexcise"></a></li>
			<li role="presentation"><a href="#sethomework" role="tab" data-toggle="tab" data-localize="mc_sethomework"></a></li>
			<li role="presentation"><a href="#publishcourse" role="tab" data-toggle="tab" data-localize="mc_publishcourse"></a></li>
		</ul>
		<div class="tab-content">
			<div role="tabpanel" class="tab-pane container-fluid fade in active" id="ctcourse">
				<div class="row">
					<div class="col-xs-9 container-fluid centerBtn">
						<!--课程名-->
						<div class="row courseBasicInfo">
							<div class="col-xs-3">
								<label data-localize="kc_coursename"></label>
								<span style="color:red;">*</span>
							</div>
							<div class="col-xs-8">
								<input type="text" id="courseNameString" data-localize="kc_coursename">
							</div>
						</div>
						<!--课程分类-->
						<div class="row courseBasicInfo">
							<div class="col-xs-3">
								<label data-localize="mc_classfycourse"></label>
								<span style="color:red;">*</span>
							</div>
							<div class="col-xs-8">
								<select class="form-control LSType">
								</select>
							</div>
						</div>
						<!--课程封面-->
						<div class="row courseBasicInfo">
							<div class="col-xs-3">
								<label data-localize="mc_courseAvatar"></label>
								<span style="color:red;">*</span>
							</div>
							<div class="col-xs-8">
								<img src="./imgs/lessonDefault.png" id="courseAvatar" alt="avatar">
								<div class="btn btn-info fileuploadshell" onclick="javascript:document.getElementById('selectAvatar').click();">
									<input type="file" class="form-control ifile" name="selectAvatar" id="selectAvatar" accept="image/*" onchange="redUserAvatar('selectAvatar')">
									<span class="glyphicon glyphicon-cloud-upload"></span>&nbsp;
									<span id="selectAvatarNm" data-localize="cm_coverupload"></span>
								</div>
							</div>
						</div>
						<!--课程简介-->
						<div class="row courseBasicInfo">
							<div class="col-xs-3">
								<label data-localize="mc_courseintro"></label>
								<span style="color:red;">*</span>
							</div>
							<div class="col-xs-8">
								<textarea rows="8" id="courseIntro" data-localize="mc_courseintro"></textarea>
							</div>
						</div>
						<!--教师-->
						<div class="row courseBasicInfo">
							<div class="col-xs-3">
								<label data-localize="nav_teacher"></label>
							</div>
							<div class="col-xs-8 container-fluid greyBG">
								<div class="row">
									<div class="col-xs-3">
										<img src="<%=photoUrl%>" data-act='<%=session.getAttribute("userid")%>' data-toggle="modal" data-target="#addteacher" id="teacherAvatar" alt="teacherAvatar">
									</div>
									<div class="col-xs-9">
										<input type="text" value='<%=UserInfo.getName()%>' disabled>
										<span style="color:red;position: absolute;left: 2px;top: 25px;">*</span>
										<textarea rows="4" id="teacherIntro" data-localize="cs_teacherIntro"></textarea>
									</div>
								</div>
							</div>
						</div>
						<!--助教-->
						<div class="row courseBasicInfo">
							<div class="col-xs-3">
								<label data-localize="cs_assistantTea"></label>
							</div>
							<div class="col-xs-8 container-fluid greyBG">
								<div class="row" id="ASTList">
									<div class="col-xs-2 addTea">
										<img src="./imgs/userAdd.png" data-act="add" data-toggle="modal" data-target="#addteacher" alt="Userimg">
									</div>
								</div>
							</div>
						</div>
						<!--课程标签-->
						<div class="row courseBasicInfo">
							<div class="col-xs-3">
								<label data-localize="mc_courselabl"></label>
							</div>
							<div class="col-xs-8 container-fluid">
								<div class="btn-group" id="SVTags">
								</div>
							</div>
						</div>

						<button type="button" class="btn btn-primary" onclick="save(1)" data-localize="kc_btn_save"></button>
						<button type="button" class="btn btn-success" onclick="save(1,true)" data-localize="mc_saveintonetstep"></button>
					</div>
					<div class="col-xs-2">
						<div id="advertisement" class="carousel slide" data-ride="carousel">
							<ol class="carousel-indicators">
							</ol>

							<div class="carousel-inner" role="listbox">
							</div>

							<a class="left carousel-control" href="#advertisement" role="button" data-slide="prev">
								<span class="glyphicon glyphicon-chevron-left"></span>
								<span class="sr-only" data-localize="nav_pre"></span>
							</a>
							<a class="right carousel-control" href="#advertisement" role="button" data-slide="next">
								<span class="glyphicon glyphicon-chevron-right"></span>
								<span class="sr-only" data-localize="nav_next"></span>
							</a>
						</div>
						<div id="supermapfaq">
							<h4 data-localize="ms_FAQ"></h4>
							<ul>
							</ul>
						</div>
					</div>
				</div>
			</div>
			<div role="tabpanel" class="tab-pane fade" id="setcourseexcise">
				<iframe id="setcourseexciseIframe" width="100%" height="100%" seamless frameborder="0" src=""></iframe>
				<button type="button" class="btn btn-primary actBTN" onclick="save(2)" data-localize="kc_btn_save"></button>
				<button type="button" class="btn btn-success actBTN" onclick="save(2,true)" data-localize="mc_saveintonetstep"></button>
			</div>
			<div role="tabpanel" class="tab-pane fade" id="sethomework">
				<iframe id="sethomeworkIframe" width="100%" height="100%" seamless frameborder="0" src=""></iframe>
				<button type="button" class="btn btn-primary" onclick="save(3)" data-localize="kc_btn_save"></button>
				<button type="button" class="btn btn-success" onclick="save(3,true)" data-localize="mc_saveintonetstep"></button>
			</div>
			<div role="tabpanel" class="tab-pane container-fluid fade" id="publishcourse">
				<div class="row">
					<div class="col-xs-1"></div>
					<div class="col-xs-8 centerBtn">
						<br>
						<img src="" alt="LessonCover" id="PUB_LessonCover">
						<h4 id="PUB_LessonName"></h4>
						<h5 id="PUB_TeacherName"></h5>
						<br><br>
						<button type="button" class="btn btn-primary" onclick="save(4)" data-localize="mc_publishcoursebtn"></button>
						<a type="button" class="btn btn-success" href="./master?lt=course" data-localize="mc_returnCourses"></a>
					</div>
					<div class="col-xs-2">
						<div id="advertisement" class="carousel slide" data-ride="carousel">
							<ol class="carousel-indicators">
							</ol>

							<div class="carousel-inner" role="listbox">
							</div>

							<a class="left carousel-control" href="#advertisement" role="button" data-slide="prev">
								<span class="glyphicon glyphicon-chevron-left"></span>
								<span class="sr-only" data-localize="nav_pre"></span>
							</a>
							<a class="right carousel-control" href="#advertisement" role="button" data-slide="next">
								<span class="glyphicon glyphicon-chevron-right"></span>
								<span class="sr-only" data-localize="nav_next"></span>
							</a>
						</div>
						<div id="supermapfaq">
							<h4 data-localize="ms_FAQ"></h4>
							<ul>
							</ul>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	<!--模态框-->
	<div class="modal fade" id="addteacher" tabindex="-1" role="dialog" aria-hidden="true">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal">
						<span aria-hidden="true">&times;</span>
						<span class="sr-only">&nbsp;</span>
					</button>
					<h4 class="modal-title" id="addteachertitle"></h4>
				</div>
				<div class="modal-body container-fluid">
					<div class="row searchUser">
						<div class="col-xs-1"></div>
						<div class="col-xs-8 SC_name">
							<div class="input-group">
								<span class="input-group-addon" data-localize="myinfo_userloginName"></span>
								<input type="text" class="form-control" id="AST_name" data-localize="mc_aststealmtip">
							</div>
							<div class="input-group">
								<span class="input-group-addon" data-localize="ms_nickname"></span>
								<input type="text" class="form-control" id="AST_nickname" data-localize="mc_aststeannmtip">
							</div>
						</div>
						<div class="col-xs-2 SC_Serch">
							<button type="button" class="btn btn-default" onclick="checkAstInfo()"><span class="glyphicon glyphicon-search"></span></button>
						</div>
					</div>
					<div class="row" id="UserInfoCan">
						<div class="col-md-1"></div>
						<div class="col-md-3">
							<img src="" alt="Userimg" id="modelUserimg">
							<div id="sltUavaFile" class="btn btn-info fileuploadshell" onclick="javascript:document.getElementById('changeUserImg').click();">
								<input type="file" class="form-control ifile" name="changeUserImg" id="changeUserImg" accept="image/*" onchange="redUserAvatar('changeUserImg')">
								<span class="glyphicon glyphicon-cloud-upload"></span>&nbsp;
								<span id="changeUserImgNm" data-localize="mi_avatarupload"></span>
							</div>
						</div>
						<div class="col-md-7 container-fluid table-responsive">
							<table class="table table-bordered">
								<tbody id="userInfobody" class="resourcesbody">
								</tbody>
							</table>
						</div>
					</div>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" data-dismiss="modal" data-localize="pm_cancle"></button>
					<button id="addOrModifyTeaBtn" type="button" class="btn btn-primary" data-localize="kc_confirm"></button>
				</div>
			</div>
		</div>
	</div>
</div>

<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="http://cdn.bootcss.com/jquery/1.12.1/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="http://cdn.bootcss.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<script src="script/jquery.i18n.properties.min.js"></script>
<script src="script/jquery.i18n.init.js"></script>
<script src="script/ajaxfileupload_zhang.js"></script>
<script src="script/layerui/layer.js"></script>
<script src="script/layui/layui.js"></script>
<script src="script/cOmCourse.js"></script>
</body>
</html>